﻿using System.Collections.ObjectModel;
using System.Windows;

namespace ibba.src.slcomponentes
{
    public sealed class SwitchCase : DependencyObject
    {
        public object When
        {
            get { return (object)GetValue(WhenProperty); }
            set { SetValue(WhenProperty, value); }
        }

        // Using a DependencyProperty as the backing store for When.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty WhenProperty =
            DependencyProperty.Register("When", typeof(object), typeof(SwitchCase), new PropertyMetadata(default(object)));



        public object Then
        {
            get { return (object)GetValue(ThenProperty); }
            set { SetValue(ThenProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Then.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ThenProperty =
            DependencyProperty.Register("Then", typeof(object), typeof(SwitchCase), new PropertyMetadata(default(object)));
        
    }

    public sealed class SwitchCaseCollection : Collection<SwitchCase>
    {
        public void Add(object when, object then)
        {
            Add(
                new SwitchCase
                {
                    When = when,
                    Then = then
                }
            );
        }
    }
}
